<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/3 0003
 * Time: 17:30
 */
namespace app\api\controller;

use think\Controller;
use think\View;
use think\Db;

class Contact extends Controller
{

    //列表展示
    public function index()
    {


        $contact =Db('contact')->field('name,address,telephone,phone,email,wechat,wechats,pic,microblog,pics')->select();
        if($contact)
        {
            $data = array('code'=>200,'msg'=>'success',$contact);
            return json_encode($data,JSON_FORCE_OBJECT);
        }
        else
        {
            $data = ['code'=>400,'msg'=>'field'];
            return json_encode($data,TRUE);

        }

    }




}